const vscode = require('vscode');
const nls = require('vscode-nls');

// The example uses the file message format.
const localize = nls.config({ messageFormat: nls.MessageFormat.file })();
const sayByeCommand = require('./src/demo/index') ;
/**
 * 插件被激活时触发，所有代码总入口
 * @param {*} context 插件上下文
 */
exports.activate = function(context) {
    console.log(sayByeCommand, '-----');
    const helloCmd = vscode.commands.registerCommand('extension.sayHello', () => {
		const message = localize('extension.sayBye.text', 'Hello');
		vscode.window.showInformationMessage(message);
    });
    
    const byeCmd = vscode.commands.registerCommand(
		'extension.sayBye',
		sayByeCommand
	);
    context.subscriptions.push(helloCmd, byeCmd);

    // 自动提示演示，在dependencies后面输入.会自动带出依赖
    // this.dependencies.
};

/**
 * 插件被释放时触发
 */
exports.deactivate = function() {
    console.log('您的扩展“vscode-plugin-demo”已被释放！')
};